package com.typ.member.dao.mapper

import com.typ.member.Application
import com.typ.member.dao.model.MemberCardDto
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.test.context.ActiveProfiles
import org.springframework.test.context.ContextConfiguration
import spock.lang.Specification

import javax.annotation.Resource

@ContextConfiguration(classes = Application.class)
@SpringBootTest
@ActiveProfiles("dev")
class MemberCardDtoMapperTest extends Specification {

    @Resource
    private MemberCardDtoMapper memberCardDtoMapper

    def "插入测试数据"() {
        given:
        MemberCardDto memberCardDto = new MemberCardDto()
        memberCardDto.setCode(UUID.randomUUID().toString().replaceAll("-", ""))
        memberCardDto.setName("EdenHe")
        memberCardDto.setSex(1)
        memberCardDto.setPhone("15810550227")
        memberCardDto.setPoints(BigDecimal.ZERO)
        memberCardDto.setBalance(BigDecimal.ZERO)
        memberCardDto.setCreated(new Date())
        memberCardDto.setCreator("admin")
        memberCardDto.setModified(new Date())
        memberCardDto.setEditor("admin")
        memberCardDto.setRemark("这是备注信息")
        memberCardDto.setStatus(new Byte("1"))
        when:
        memberCardDtoMapper.insert(memberCardDto)
        then:
        true
    }
}
